package com.dy.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName:
 * @Author: 仄言in
 * @Desctiption: (描述) 自定义负载均衡规则
 * @Date: 2021/9/14 15:49
 * @Version 1.0 (版本)
 */
@Configuration
public class MyRibbonRule {
    /**
     * 自定义负载均衡规则
     * RandomRule()：随机策略
     * @return
     **/
    @Bean
    public IRule myrule(){
        return new RandomRule();
    }
}
